package com.example.thread.demo.completablefuture;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

/**
 * @author zhy
 * @date 2020/5/20 2:49 下午
 * @description
 */
public class CompletableFutureTest4 {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        CompletableFuture<String> cf = CompletableFuture.supplyAsync(() -> "hello,张海洋")
                .thenApply(s -> s + "@学习CompletableFuture")
                .thenApply(String::toUpperCase);
        System.out.println(cf.get());


    }
}
